<?php if ( 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']) ) die('Please do not load this page directly. Thanks!') ?>
<?php if ( !empty($post->post_password) ) if ( $_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password ) die('This article is password-protected. Enter your password to read the comments.') ?>
<?php if ( $comments ) : ?>
<a name="comments"></a>
<div class="block">
<h4><?php comments_number('No comments','1 comment','% comments') ?></h4>
<p>
<?php if ( 'open' != $post->comment_status ) : ?>
Comments are now disabled for this article, thank you for your participation.
<?php endif // 'open' != $post->comment_status ?>
Read the comments left by other users below, or:
</p>
<ul>
<?php if ( 'open' == $post->comment_status ) : ?>
<li><a href="#respond">Leave your comment</a></li>
<?php endif // 'open' == $post->comment_status ?>
<?php if ( 'open' == $post->ping_status ) : ?>
<li><a href="<?php trackback_url(true) ?>" rel="trackback">Notify a mention to this article (trackback)</a></li>
<?php endif // 'open' == $post->ping_status ?>
<li><a href="<?php echo comments_rss() ?>" rel="feed">Subscribe to the comments on this article (RSS)</a></li>
</ul>
</div>
<?php $count = 1 ?>
<?php foreach ( $comments as $comment ) : ?>
<a name="comment-<?php comment_ID() ?>"></a>
<?php if ( !in_array(get_comment_type(),array('pingback','trackback')) ) : ?>
<?php if ( get_comment_author_email() == get_the_author_email() ) : ?>
<div class="my-comment">
<?php else : // get_comment_author_email() == get_the_author_email() ?>
<div class="comment">
<?php endif // get_comment_author_email() == get_the_author_email() ?>
<?php edit_comment_link('Edit','<p class="edit">','</p>') ?>
<p>
<?php if(function_exists('cmd_show_avatar')) cmd_show_avatar(); ?>
<?php if ( preg_match('#^http\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z0-9]+#i',get_comment_author_url()) ) : ?>
<strong><a href="<?php comment_author_url() ?>" rel="nofollow"><?php comment_author() ?></a></strong><br />
<?php else : // preg_match('#^http\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z0-9]+#i',get_comment_author_url()) ?>
<strong><?php comment_author() ?></strong><br />
<?php endif // preg_match('#^http\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z0-9]+#i',get_comment_author_url()) ?>
<a href="#comment-<?php comment_ID() ?>" title="Permanent link to this comment">#<?php echo $count ?></a>.
<?php comment_date('F jS, Y') ?>, at <?php comment_time('g:i A') ?>.
</p>
<?php comment_text() ?>
<?php else : // !in_array(get_comment_type(),array('pingback','trackback'))?>
<div class="trackback">
<?php edit_comment_link('Edit','<p class="edit">','</p>') ?>
<?php $comment_author_domain = parse_url(get_comment_author_url()); $comment_author_domain = $comment_author_domain['host']; if ( strpos($comment_author_domain,"www.") === 0 ) $comment_author_domain = substr($comment_author_domain,4); $comment_author_domain = ucfirst($comment_author_domain) ?>
<p>
<img src="<?php bloginfo('template_directory') ?>/img/default-avatar.png" width="30" height="30" alt="Trackback" class="gravatar" />
<strong><a href="<?php comment_author_url() ?>" rel="nofollow">Mention from <?php echo $comment_author_domain ?></a></strong><br />
<a href="#comment-<?php comment_ID() ?>" title="Permanent link to this comment">#<?php echo $count ?></a>.
<?php comment_date('F jS, Y') ?>, at <?php comment_time('g:i A') ?>.
</p>
<p><a href="<?php comment_author_url() ?>" rel="nofollow"><?php comment_author() ?></a>: <?php echo str_replace("[...] ","",get_comment_excerpt()) ?></p>
<?php endif // !in_array(get_comment_type(),array('pingback','trackback')) ?>
<?php $count++ ?>
<?php if ( $comment->comment_approved == '0' ) : ?>
<p><strong>Pending moderation</strong>: Your comment is pending moderation: at the moment nobody can read it besides you.</p>
<?php endif // $comment->comment_approved == '0' ?>
</div>
<?php endforeach // $comments as $comment?>
<?php else : // $comments ?>
<a name="comments"></a>
<?php if ( 'open' == $post->comment_status ) : ?>
<div class="block">
<h4>No comments</h4>
<p>There are still no comments on this article.</p>
<ul>
<li><a href="#respond">Leave your comment</a></li>
<?php if ( 'open' == $post->ping_status ) : ?>
<li><a href="<?php trackback_url(true) ?>" rel="trackback">Notify a mention to this article (trackback)</a></li>
<?php endif // 'open' == $post->ping_status ?>
<li><a href="<?php echo comments_rss() ?>" rel="feed">Subscribe to the comments on this article (RSS)</a></li>
</ul>
</div>
<?php else : // 'open' == $post->comment_status?>
<div class="block">
<h4>Comments disabled</h4>
<p>Comments on this article have been disabled.</p>
<?php if ( 'open' == $post->ping_status ) : ?>
<ul>
<li><a href="<?php trackback_url(true) ?>" rel="trackback">Notify a mention to this article (trackback)</a></li>
</ul>
<?php endif // 'open' == $post->ping_status ?>
</div>
<?php endif // 'open' == $post->comment_status ?>
<?php endif // $comments ?>
<?php if ( 'open' == $post->comment_status ) : ?>
<a name="respond"></a>
<div class="block">
<h4>Leave your comment...</h4>
<p>If you want to leave your comment on this article, simply fill out the next form:</p>
<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
<p>You have to be <a href="<?php bloginfo('home') ?>/wp-login.php?redirect_to=<?php echo urlencode($_SERVER['REQUEST_URI']) ?> ?>">identified</a> to write a comment.</p>
<?php else : // get_option('comment_registration') && !$user_ID?>
<form action="<?php bloginfo('home') ?>/wp-comments-post.php" method="post">
<?php if ( $user_ID ) : ?>
<p>Identified as <strong><a href="<?php bloginfo('home') ?>/wp-admin/profile.php" title="Account profile"><?php echo $user_identity ?></a></strong> <a href="<?php bloginfo('home') ?>/wp-login.php?action=logout&amp;redirect_to=<?php echo urlencode($_SERVER['REQUEST_URI']) ?>" title="Terminate the session with this account">(Exit)</a>.</p>
<p>
<?php else : // $user_ID?>
<p>
<label for="author"><input type="text" name="author" id="author" value="<?php echo $comment_author ?>" size="30" /> Name <?php if ( $req ) echo "(required)" ?></label><br />
<label for="email"><input type="text" name="email" id="email" value="<?php echo $comment_author_email ?>" size="30" /> Email (won't be published) <?php if ( $req ) echo "(required)" ?></label><br />
<label for="url"><input type="text" name="url" id="url" value="<?php echo $comment_author_url ?>" size="30" /> Web page</label><br />
<?php endif // $user_ID ?>
<textarea name="comment" id="comment" cols="70" rows="10"></textarea>
</p>
<p><input name="submit" type="submit" value="Send comment" class="button" /></p>
<?php do_action('comment_form',$post->ID) ?>
<input type="hidden" name="comment_post_ID" value="<?php the_ID() ?>" />
</form>
<p>You can use these XHTML tags: <?php echo allowed_tags() ?>.</p>
<?php endif // get_option('comment_registration') && !$user_ID ?>
</div>
<?php endif // 'open' == $post->comment_status ?>
